package com.kube.design.observer;

import java.util.Observer;

/**
 * @author q.zhangr
 * @version 1.0.0
 * @date 2020/7/15
 */
public class ObserverTest {


    public static void main(String[] args) {
        ConcreteSubject observable = new ConcreteSubject();

        Observer concreteObserver1 = new ConcreteObserver1();
        Observer concreteObserver2 = new ConcreteObserver2();

        observable.addObserver(concreteObserver1);
        observable.addObserver(concreteObserver2);

        observable.setPrice(10);
        observable.setPrice(-8);

    }

}
